package com.wuage.application.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wuage.domain.mapper.UacTenantMapper;
import com.wuage.domain.model.UacTenant;
import com.wuage.application.IUacTenantService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 租户表(UacTenant)表服务实现类
 * @Author: makejava
 * @Date: 2021-09-27 17:00:43
 */
@Service("uacTenantService")
public class UacTenantServiceImpl extends ServiceImpl<UacTenantMapper, UacTenant> implements IUacTenantService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public UacTenant create(String tenantName) {
        UacTenant uacTenant =
                UacTenant.builder()
                        .name(tenantName)
                        .description(tenantName)
                        .build();
        this.save(uacTenant);
        return uacTenant;
    }
}